<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
</head>
<body bgcolor="#87cefa">
<div id="app" >
  <template>
    <div class="block">
      <el-carousel height="400px"  type="card" >
        <el-carousel-item v-for="item in list" :key="item">
          <img :src="item" >
        </el-carousel-item>
      </el-carousel>
    </div>
  </template>
  <h1>自己的轮播图</h1>
  <div style="height: 150px;width: 900px;margin-left: 5%">
    <el-carousel height="400px"  >
      <el-carousel-item v-for="item in list" :key="item">
        <img :src="item" >
      </el-carousel-item>
    </el-carousel>
  </div>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
  let v = new Vue({
    el: '#app',
    data: function() {
      return {
        list:[
          "https://tse2-mm.cn.bing.net/th/id/OIP-C.GOJtEvAFqEAWt09YU9Eq1gHaEo?pid=ImgDet&rs=1",
          "https://img.alicdn.com/imgextra/i1/2562052761/TB2x1dKX8PCIuJjSZJiXXaCVXXa_!!2562052761.jpg",
          "https://img.alicdn.com/imgextra/i3/2562052761/TB2yQyLa.ifF1JjSszcXXc2qpXa_!!2562052761.jpg",
          "https://ts1.cn.mm.bing.net/th/id/R-C.456f2bdb78b82fc69a178cb6eb4ec634?rik=meMbfo5W46XtiQ&riu=http%3a%2f%2ftvax1.sinaimg.cn%2flarge%2f9afb97dagy1fx6dzgslx8j20sg0gbtij.jpg&ehk=QUE9OHk2iEgWbjc%2brT0zZcGsItlHc5Pt89XkA4Y99yE%3d&risl=&pid=ImgRaw&r=0"
        ]

      }
    },
    methods: {

    }
  })
</script>
<style>
  #app{
    text-align: center;
    margin-left: 142px;
    width: 80.6%;
    height: auto;
  }
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 150px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
  img{
    /*设置图片宽度和浏览器宽度一致*/
    width:100%;
    height: inherit;


  }
</style>
</html>